/**
 *  TodayPluginWnd.h
 *
 *  Copyright (C) 2008  David Andrs <pda@jasnapaka.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#if !defined(AFX_TODAYPLUGINWND_H__2905BEE8_5F40_469E_A55A_B16089E759AB__INCLUDED_)
#define AFX_TODAYPLUGINWND_H__2905BEE8_5F40_469E_A55A_B16089E759AB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TodayPluginWnd.h : header file
//


/////////////////////////////////////////////////////////////////////////////
// CTodayPluginWnd window

class CTodayPluginWnd : public CWnd {
// Construction
public:
	CTodayPluginWnd();
	virtual ~CTodayPluginWnd();

// Attributes
public:

// Operations
public:
	BOOL Create(HWND hwndParent);
	void OpenConfig();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTodayPluginWnd)
	protected:
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL

// Implementation
public:

	static BOOL Register();
	static BOOL Unregister();

	void LoadFonts();

	// Generated message map functions
protected:
//	FILETIME LastModified;
//	void GetContactsLastModified(FILETIME *ft);

	HWND HParentWnd;
	HICON HIcon;
	CFont m_fntNormal, m_fntBold;
	BOOL Selected;
	int RowHeight;
	int LineSpacing;
	UINT TapAndHoldTimer;
	CPoint LastCursorPos;

	SYSTEMTIME LastDate;
	BOOL Update;
	int YOfs;

	// data
	int Days;
	void CalcDays(SYSTEMTIME &st);

	//{{AFX_MSG(CTodayPluginWnd)
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnDestroy();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	afx_msg void OnSettings();

	LRESULT OnUIMetricChange(WPARAM wParam, LPARAM lParam);

	void ShowConfig();

	void OnAction();

	void ContextMenu(CPoint *pt);

	BOOL OnQueryRefreshCache(TODAYLISTITEM *ptli);
	void OnClearCache(TODAYLISTITEM *ptli);

	DECLARE_MESSAGE_MAP()
};

extern CTodayPluginWnd		TodayPluginWnd;

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TODAYPLUGINWND_H__2905BEE8_5F40_469E_A55A_B16089E759AB__INCLUDED_)
